import java.io.*;
import javax.crypto.*;
/*
20175131王泽龙
 */
public class AES{
    public static void main(String args[]) throws Exception{
        KeyGenerator kg=KeyGenerator.getInstance("AES");
        kg.init(128);

        SecretKey k=kg.generateKey( );
        FileOutputStream  f=new FileOutputStream("key1.dat");
        ObjectOutputStream b=new  ObjectOutputStream(f);
        b.writeObject(k);
    }
}
